<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!--<meta http-equiv="Content-Security-Policy"-->
    <!--content="default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data: content:;">-->
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <!--<meta name="viewport"-->
    <!--content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">-->
    <link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
    <link rel="stylesheet" type="text/css" href="css/bootstrap-theme.css"/>
    <link rel="stylesheet" type="text/css" href="css/calculate.css">
    <title>Hello World</title>
</head>
<body ng-app="calculate">
<header class="toolbar">
    <div class="glyphicon glyphicon-menu-left left"></div>
    <div>计算器</div>
</header>

<!--历史记录-->
<section class="history-log" ng-controller="HistoryLogController as controller">
    <div class="history-log-none" ng-show="historyData===null||historyData.length ===0">
        <span>无历史记录</span>
    </div>
    <div ng-show="historyData!==null&&historyData.length >0">
        <a class="right clear-history-log" href="#" ng-click="controller.clearHistoryLog()">清除历史记录</a>
        <ul id="history-log-list" class="clear-float">
            <li ng-repeat="x in historyData">
                <div>
                    <span ng-repeat="bean in x.list" ng-class="{'0':'num','1':'symbol'}[bean.type]"><span
                            ng-show="bean.type===1"> </span>{{bean.text}}<span ng-show="bean.type===1"> </span></span>
                </div>
                <div class="symbol">
                    <span>=</span>
                </div>
                <div class="num">
                    <span>{{x.result}}</span>
                </div>
                <div class="divider"></div>
            </li>
        </ul>
    </div>
</section>

<div class="divider" style="height: 2px"></div>

<!--实时计算结果-->
<section class="calculate-content clear-float" ng-controller="CurrLogController as controller">
    <div>
        <span ng-repeat="bean in currentData.list" ng-class="{'0':'num','1':'symbol'}[bean.type]">
            <span ng-show="bean.type===1"> </span>{{bean.text}}<span ng-show="bean.type===1"> </span>
        </span>
    </div>
    <div id="calculate-content-result">{{currentData.result}}</div>
</section>

<!--计算器-->
<section class="calculate-btn">
    <table ng-controller="CalculateBtnController as calculateBtn">
        <tr ng-repeat="oneRow in calculateBtn.btnData">
            <td ng-repeat="x in oneRow"
                class="btn calculate-btn-td "
                ng-click="calculateBtn.clickTd(x.name)"
                ng-class="{'left':'calculate-btn_td_left','top':'calculate-btn_td_top','equal':'calculate-btn_td_equal','num':'calculate-btn_td_num'}[x.class]">
                <span>{{x.name}}</span>
            </td>
        </tr>
    </table>
</section>

<footer class="clear-float">
</footer>

<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript" src="js/angular.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/calculate.js"></script>
</body>
</html>